Skip to content

define scoutd kernel cmdline boostrap contract#15

Merged
t0gun merged 1 commit intomainfrom
dev
Apr 15, 2026
Merged

define scoutd kernel cmdline boostrap contract#15
t0gun merged 1 commit intomainfrom
dev

Conversation

@t0gun
Copy link
Copy Markdown
Member

@t0gun t0gun commented Apr 15, 2026

This PR adds the first kernel command line bootstrap contract for scoutd. It defines a small scoutd owned schema for early guest boot and parses only the values needed before networking and MMDS are available.
The new parser reads the kernel command line, extracts the required bootstrap fields, validates them, and rejects malformed, duplicate, or missing values. On invalid bootstrap input, scoutd now fails fast during early boot instead of continuing with a bad guest configuration.

This keeps the kernel command line intentionally small and focused while setting up the next phase of work, which is guest networking bring up. Build and tests pass with Zig 0.15.2.

@t0gun t0gun self-assigned this Apr 15, 2026
@t0gun t0gun added the enhancement New feature or request label Apr 15, 2026
@t0gun t0gun linked an issue Apr 15, 2026 that may be closed by this pull request
@t0gun t0gun merged commit d957a0f into main Apr 15, 2026
3 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a kernel command-line parser in src/cmdline.zig to extract network configuration for the scoutd service. It includes logic for reading /proc/cmdline, parsing IPv4 addresses with CIDR prefixes, and handling potential errors during the bootstrap process. Feedback suggests using std.mem.tokenizeAny for more robust tokenization of command-line arguments and std.mem.indexOfScalar for more efficient character searching.

Comment thread src/cmdline.zig
Comment thread src/cmdline.zig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define and implement the kernel cmdline bootstrap contract

1 participant